/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package UserInterface;

import Controller.Node;
import java.awt.Canvas;
import java.awt.Color;
import java.awt.Graphics;
import java.awt.Point;

/**
 *
 * @author subx
 */
public class CircleShape extends Shape {

    private String label;
    private Point position;
    private int radius = 20;
    private Color color;


    public CircleShape() {
        label = new String();
    }

    public CircleShape(String label) {
        this.label = label;
    }

    public CircleShape(String label, Point position, Color color) {
        this.label = label;
        this.position = position;
        this.color = color;
    }

    public CircleShape(String l, Node node) {
        label = l;
        position = node.getPosition();
        color = Color.WHITE;
    }

    /**
     * Get the value of color
     *
     * @return the value of color
     */
    public Color getColor() {
        return color;
    }

    /**
     * Set the value of color
     *
     * @param color new value of color
     */
    public void setColor(Color color) {
        this.color = color;
    }

    /**
     * Get the value of label
     *
     * @return the value of label
     */
    public String getLabel() {
        return label;
    }

    /**
     * Set the value of label
     *
     * @param label new value of label
     */
    public void setLabel(String label) {
        this.label = label;
    }

    public Point getPosition() {
        return position;
    }

    public void setPosition(Point position) {
        this.position = position;
    }

    public int getRadius() {
        return radius;
    }

    public void setRadius(int radius) {
        this.radius = radius;
    }

    @Override
    public void draw(Canvas c) {
        Graphics g = c.getGraphics();

        g.setColor(color);
        g.fillOval(getPosition().y, getPosition().x, getRadius(), getRadius());
        g.setColor(Color.DARK_GRAY);
        g.drawOval(position.y, position.x, radius, radius);

        g.setColor(Color.BLACK);
        g.drawString(label, getPosition().y + (getRadius()/2), 5 + getPosition().x + (getRadius()/2));
    }

}
